<?php

namespace App\Http\Requests\Admin\UserPointLog;

use App\Http\Requests\Request;

class UPLRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 验证规则
     *
     * @return array
     */
    public function rules()
    {
        return [
//            'title' => 'required|unique:ad|max:255',
            'user_id' => 'required|integer',
            'type' => 'required|boolean',
            'number' => 'required|integer|max:10',
            'reason' => 'required|max:255',
            'update_time' => 'required|date',
        ];
    }

    /**
     * 验证信息
     * @return array
     */

    public function messages()
    {
        return [
//            'position_key.required' => '请填写广告位置标识',
//            'position_key.unique'  => '广告位置标识已存在',
//            'position_key.max'  => '广告位置标识必须小于30字符',

            'user_id.required' => '用户id为空',
            'user_id.integer'  => '用户id错误',

            'type.required' => 'type不能为空',
            'type.boolean'  => 'type类型错误',

            'number.required' => '数量不能为空',
            'number.max'  => '数量不能超过9999999999',
            'number.integer'  => '用户id错误',

            'reason.required' => '请输入原因',
            'reason.max' => '超过255个字符限制',

            'update_time.required' => '时间不能为空',
            'update_time.date' => '类型错误',
        ];
    }
}
